/* 查找文件 192.c */


.LC0:
	.string "please input the file name you want to search:\n"

.LC1:
	.string "%s"

.LC2:
	.string "the path is:%s\n"

.LC3:
	.string "cannot find"


.globl main

main:
	pushq %rbp
	movq %rsp,%rbp
	subq $0x1000,%rsp

	movq $0,-0x1000(%rbp) /* ptr */
	movl $0,-0xff8(%rbp) /* filename */

	leaq .LC0(%rip),%rdi
	movl $0,%eax 
	call printf 

	leaq -0xff8(%rbp),%rsi /* filename */
	leaq .LC1(%rip),%rdi
	movl $0,%eax 
	call scanf 

	leaq -0xff8(%rbp),%rdi /* filename */
	movl $0,%eax 
	call searchpath 
	movq %rax,-0x1000(%rbp) /* ptr */
	cmpq $0,-0x1000(%rbp) /* ptr */
	je .Lmain_400

	movq -0x1000(%rbp),%rsi /* ptr */
	leaq .LC2(%rip),%rdi
	movl $0,%eax 
	call printf 
	jmp .Lmain_0

.Lmain_400:
	leaq .LC3(%rip),%rdi
	movl $0,%eax
	call printf 

.Lmain_0:
	movl $0,%eax
	leave
	ret
